import React, { Component } from 'react';
import Search from './components/Search';
import List from './components/List';
import './App.css';

export default class App extends Component {
  state = {
    users: [], // 存放所有用户
    isFirst: true, // 是否第一次进入
    isLoading: false, // 是否正在加载
    err: '', // 存储请求错误信息
  };

  updateAppState = (state) => {
    this.setState(state);
  };
  render() {
    return (
      <div className='container'>
        <Search updateAppState={this.updateAppState}></Search>
        <List {...this.state}></List>
      </div>
    );
  }
}
